package dev.bong.mapper;

import dev.bong.annotation.AutoFill;
import dev.bong.enumeration.OperationType;
import dev.bong.pojo.entity.LabApply;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface LabApplyMapper {



    LabApply getApplyById(Integer id);
    List<LabApply> getApplyBySemesterAndStudentId(String semester, Integer studentId);

    @AutoFill(OperationType.INSERT)
    void addApply(LabApply labApply);


    @AutoFill(OperationType.UPDATE)
    void updateApply(LabApply labApply);

    @Update("update lab_apply set apply_status = 2 where id = #{applyId}")
    void confirmApply(Integer applyId);

    List<LabApply> selectApplyList();

    @Update("update lab_apply set apply_status = #{applyStatus} where id = #{applyId}")
    void approvalBorrow(Integer applyId, Integer applyStatus);
}
